<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="">{$type.name}列表</a></li>
			<if condition="$type['id'] neq 1">
				<li><a href="{:U('add',array('type_id'=>$type['id']))}">添加{$type.name}</a></li>
			</if>
			
		</ul>
		<form class="well form-search" method="post" id="cid-form">
			置顶：
			<select id="istop" name="istop" style="width: 120px;">
				<option value=''>全部</option>
				<option value='1'>置顶</option>
				<option value='0'>未置顶</option>
			</select> &nbsp;&nbsp;

			时间：
			<input type="text" name="start_time" class="js-datetime" value="{$formget.start_time|default=''}" style="width: 120px;" autocomplete="off">-
			<input type="text" class="js-datetime" name="end_time" value="{$formget.end_time|default=''}" style="width: 120px;" autocomplete="off"> &nbsp; &nbsp;
			关键字：
			<input type="text" name="keyword" style="width: 200px;" value="{$formget.keyword|default=''}" placeholder="请输入关键字...">
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="">清空</a>
			<input type="hidden" name="type_id" value="{$type.id}">
		</form>


		<form class="js-ajax-form" method="post">
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('listorders')}">{:L('SORT')}</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('star',array('isstar'=>1))}" data-subcheck="true">加精</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('star',array('isstar'=>0))}" data-subcheck="true">取消加精</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('top',array('istop'=>1))}" data-subcheck="true">置顶</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('top',array('istop'=>0))}" data-subcheck="true">取消置顶</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('status',array('status'=>1))}" data-subcheck="true">{:L('DISPLAY')}</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('status',array('status'=>0))}" data-subcheck="true">{:L('HIDDEN')}</button>
				<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="{:U('delete')}" data-subcheck="true" data-msg="你确定删除吗？">{:L('DELETE')}</button>
			</div>
			<php> $status=array("1"=>L('DISPLAY'),"0"=>L('HIDDEN')); </php>
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
						<th width="50">{:L('SORT')}</th>
						<th width="30">ID</th>
						<th width="100">标题</th>
						<th width="200">内容</th>
						<th width="30">点击</th>
						<th width="30">赞</th>
						<th width="120">发表时间</th>
						<th width="50">查看内容</th>
						<th width="50">查看评论</th>
						<th width="100">{:L('STATUS')}</th>
						<th width="150">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<foreach name="bbs" item="vo">
				<tr>
					<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}"></td>
					<td><input name='listorders[{$vo.id}]' class="input input-order mr5" type='text' size='3' value='{$vo.listorder}'></td>
					<td>{$vo.id}</td>
					<td>{$vo.title}</td>
					<td>{$vo.content}</td>
					<td>{$vo.hits}</td>
					<td>{$vo.likes}</td>
					<td>{$vo.create_time}</td>
					<td>
						<a href="{:U('pageShow',array('id'=>$vo['id']))}" target="_blank">查看内容</a>
					</td>
					<td>
						<a href="{:U('commentIndex',array('bbs_id'=>$vo['id']))}">查看评论</a>
					</td>
					<td>
						<notempty name="vo.status">
							<a data-toggle="tooltip" title="已显示"><i class="fa fa-eye fa-2x"></i></a>
							<else/>
							<a data-toggle="tooltip" title="未显示"><i class="fa fa-eye-slash fa-2x"></i></a>
						</notempty>
						<notempty name="vo.isstar">
							<a data-toggle="tooltip" title="已加精"><i class="fa fa-star fa-2x"></i></a>
							<else />
							<a data-toggle="tooltip" title="未加精"><i class="fa fa-star-o fa-2x"></i></a>
						</notempty>
						<notempty name="vo.istop">
							<a data-toggle="tooltip" title="已置顶"><i class="fa fa-arrow-up fa-2x"></i></a>
							<else />
							<a data-toggle="tooltip" title="未置顶"><i class="fa fa-arrow-down fa-2x"></i></a>
						</notempty>
					</td>
					<td>
						<if condition="$type['id'] neq 1">
							<a href="{:U('add',array('id'=>$vo['id'],'type_id'=>$type['id']))}">{:L('EDIT')}</a>
						</if>
						<if condition="empty($vo['isstar']) eq 1">
							<a href="{:U('star',array('ids'=>$vo['id'],'isstar'=>1))}" class="js-ajax-dialog-btn" data-msg="确定加精此帖子吗？">加精</a>
							<else />
							<a href="{:U('star',array('ids'=>$vo['id'],'isstar'=>0))}" class="js-ajax-dialog-btn" data-msg="确定取消加精此帖子吗？">取消加精</a>
						</if>
						<if condition="empty($vo['istop']) eq 1">
							<a href="{:U('top',array('ids'=>$vo['id'],'istop'=>1))}" class="js-ajax-dialog-btn" data-msg="确定置顶此帖子吗？">置顶</a>
							<else />
							<a href="{:U('top',array('ids'=>$vo['id'],'istop'=>0))}" class="js-ajax-dialog-btn" data-msg="确定取消置顶此帖子吗？">取消置顶</a>
						</if>
						<if condition="empty($vo['status']) eq 1">
							<a href="{:U('status',array('ids'=>$vo['id'],'status'=>1))}" class="js-ajax-dialog-btn" data-msg="确定显示此帖子吗？">{:L('DISPLAY')}</a>
						<else /> 
							<a href="{:U('status',array('ids'=>$vo['id'],'status'=>0))}" class="js-ajax-dialog-btn" data-msg="确定隐藏此帖子吗？">{:L('HIDE')}</a>
						</if>
						<a href="{:U('delete',array('ids'=>$vo['id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
					</td>
				</tr>
				</foreach>
				<tfoot>
					<tr>
						<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
						<th width="50">{:L('SORT')}</th>
						<th width="30">ID</th>
						<th width="100">标题</th>
						<th width="200">内容</th>
						<th width="30">点击</th>
						<th width="30">赞</th>
						<th width="120">发表时间</th>
						<th width="50">查看内容</th>
						<th width="50">查看评论</th>
						<th width="100">{:L('STATUS')}</th>
						<th width="150">{:L('ACTIONS')}</th>
					</tr>
				</tfoot>
			</table>
			<div class="pagination">{$page}</div>
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('listorders')}">{:L('SORT')}</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('star',array('isstar'=>1))}" data-subcheck="true">加精</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('star',array('isstar'=>0))}" data-subcheck="true">取消加精</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('top',array('istop'=>1))}" data-subcheck="true">置顶</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('top',array('istop'=>0))}" data-subcheck="true">取消置顶</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('status',array('status'=>1))}" data-subcheck="true">{:L('DISPLAY')}</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('status',array('status'=>0))}" data-subcheck="true">{:L('HIDDEN')}</button>
				<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="{:U('delete')}" data-subcheck="true" data-msg="你确定删除吗？">{:L('DELETE')}</button>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
        (function(){
            $("#istop").val("<?=$formget['istop']?>");
        })();
	</script>
</body>
</html>